package com.utome.weekendproject.controller;

import com.utome.weekendproject.javabeans.SysUser;
import com.utome.weekendproject.service.securityService.LoginServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author zhangtianlong
 */
@Controller
@RequestMapping("/sysUser")
public class RegisterController {

    @Autowired
    private LoginServiceImpl loginServiceImpl;

    @PostMapping("/saveUser")
    public String register(SysUser sysUser) {
        SysUser register = loginServiceImpl.register(sysUser);
        if (register != null) {
            return "index";
        }
        return "/register";
    }

//    @PostMapping("/login")
//    public String login(SysUser sysUser) {
//        loginService.loadUserByUsername(sysUser.get)
//    }

}
